package com.chengxiaoxiao.ai_demo.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.chengxiaoxiao.ai_demo.entity.ConversationInfo;
import com.chengxiaoxiao.ai_demo.vo.form.ChatForm;
import com.chengxiaoxiao.ai_demo.vo.vo.ChatResponseVo;
import reactor.core.publisher.Flux;

/**
 * 会话接口
 *
 * @Description:
 * @Author Cheng Xiaoxiao
 * @Date: 2025/3/12 11:56
 */
public interface ConversationInfoService extends IService<ConversationInfo> {
    /**
     * 创建新会话
     *
     * @return 创建的会话信息
     */
    ConversationInfo create();

    /**
     * 根据ID修改会话信息
     *
     * @param id               会话ID
     * @param conversationInfo 会话信息
     */
    ConversationInfo editById(String id, ConversationInfo conversationInfo);

    /**
     * 删除会话
     *
     * @param id 会话ID
     */
    void deleteById(String id);

    /**
     * 根据会话进行聊天
     *
     * @param id       会话ID
     * @param chatForm 会话表单
     * @return 回答的结果
     */
    Flux<ChatResponseVo> chatStream(String id, ChatForm chatForm);
}
